from django.contrib import admin
from django.urls import path,re_path,include
from rest_framework_jwt.views import obtain_jwt_token
from . import views
from rest_framework.routers import SimpleRouter,DefaultRouter
from .views_kit import user
from sys_manager.views_kit import roles,permission,dept

urlpatterns = [re_path(r'^request/$',views.Request),

    re_path(r'^user/login/$', obtain_jwt_token), #jwt的签发 和认证token的视图类


   # re_path(r'^snippet/$',views.snippet_list),
    re_path(r'^user/register/$',user.RegisterView.as_view()),
    #修改密码
    re_path(r'^user/reset_password/(?P<pk>\d+)/$',user.ResetPasswordView.as_view()),

]

router=DefaultRouter()
router.register(r'menus',views.MenuView)
router.register(r'roles',roles.RolesView)
router.register(r'permissions',permission.PermissionView)
router.register(r'depts',dept.DeptView)
router.register(r'users',user.UserView)

urlpatterns+=router.urls
print(router)